home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextLibrary / Documentation / Sybase / DBLIB / Section2 / dbtabsource.nr < prev    next >
Encoding:
Text File  |  1993-04-22  |  2.1 KB  |  69 lines

  1. .Na "dbtabsource"
  2. .mc |
  3. .Aa
  4. .Fu
  5. Return the name and number of the table from which a particular result column 
  6. was derived.
  7. .Ih "result column, returning database table corresponding to a"
  8. .Sy
  9. .Sf "char *dbtabsource(dbproc, colnum, tabnum)"
  10. .Sp "DBPROCESS" "*dbproc"
  11. .Sp "int" "colnum"
  12. .Sp "int" "*tabnum"
  13. .Co
  14. .Bl
  15. \f2dbtabsource()\f1 is one of the \*L browse mode routines.
  16. It is usable only with results from a browse-mode SELECT (\f2i.e.,\f1
  17. a SELECT containing the key words FOR BROWSE).
  18. See the Introduction for a detailed discussion of browse mode.
  19. .Bl
  20. \f2dbtabsource()\f1 allows an application to determine which tables provided
  21. the columns in the current set of result rows. This information
  22. is valuable when using \f2dbqual()\f1
  23. to construct WHERE clauses for UPDATE and DELETE statements based on ad hoc queries.
  24. If the query has been hardcoded into the program, this routine is obviously unnecessary.
  25. .Bl
  26. The application can call
  27. \f2dbtabsource()\f1 any time after \f2dbresults()\f1.
  28. .Bl
  29. Example 7 in the \f2\*L Reference Supplement\f1 contains a call to \f2dbtabsource()\f1.
  30. .Bz
  31. .Pa
  32. .Pi dbproc
  33. A pointer to the DBPROCESS structure that provides the connection
  34. for a particular front-end/\*S process.  It contains all the
  35. information that \*L uses to manage communications and data between the
  36. front end and \*S.
  37. .Pi colnum
  38. The number of the result column of interest. Column numbers
  39. start at 1.
  40. .Pi tabnum 
  41. A pointer to an integer, which will be filled in with the
  42. table's number.  Many \*L routines that deal with
  43. browse mode accept either a table name or a table number.
  44. If \f2dbtabsource()\f1 returns NULL (see below), \f2*tabnum\f1
  45. will be set to -1. 
  46. .in -.375i
  47. .Re
  48. .br
  49. A pointer to the name of the table from which this result column was
  50. derived. A NULL return value can mean a few different things:
  51. .Bl
  52. The DBPROCESS is dead or not enabled. This is an
  53. error that will cause an application's error handler to be invoked.
  54. .Bl
  55. The column number is out of range.
  56. .Bl
  57. The column is the result of an expression, such as ``max(colname)''.
  58. .Bz
  59. .Sa
  60. dbcolbrowse,
  61. dbcolsource,
  62. dbqual,
  63. dbtabbrowse,
  64. dbtabcount,
  65. dbtabname,
  66. dbtsnewlen,
  67. dbtsnewval,
  68. .mc
  69.